<template>
  <div >
    <el-card class="box-card" style="margin: 10px;background-color: #a6c9f1;">
<!--      <div slot="header" class="clearfix">-->
<!--        <span>卡片名称</span>-->
<!--        <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
<!--      </div>-->
      <app-header></app-header>
      <app-content></app-content>
    </el-card>
  </div>
</template>

<script>
import Header from "../components/Header";
import Login from "../components/login";
import Content from "../components/Content";
import Userlist from "../components/UserList";
// import axios from "axios";
// import Camera from "./components/Camera"; //本模块仅作为网页摄像头技术验证【已废弃】
export default {
  name: "app",
  data() {
    return {
      isLogin:true,
      isAdmin:false,
    };
  },
  components: {
    "app-header": Header,
    "app-login": Login,
    "app-content": Content,
    "app-users":Userlist,
    //"app-camera": Camera, //仅作技术验证，2024-3-6废弃
  },
  created(){
    var user=JSON.parse(sessionStorage.getItem('user'));
    if (user && user.username.length>0) {
      if (user.username==='admin')
        this.isAdmin=true;
      this.isLogin=false;
    }
    else {
      this.$router.push('/login')
    }
    // this.getcount();
  },
  methods: {
    tologin(){
      sessionStorage.clear();
      this.isAdmin=false;
      this.isLogin=true;
    },
    tomine(){
      this.isAdmin=false;
    },
  },
};
</script>

<style scoped>
  .top-left-edition span i {
    float: left;
    margin-right: 10px;
  }

  i,
  input,
  label {
    vertical-align: middle;
  }

  i {
    border: 0;
    display: block;
    cursor: pointer;
  }

  .top-left-edition span {
    float: left;
    font-size: 25px;
    color: #999999;
    line-height: 24px;
    margin-right: 40px;
  }

</style>
